<?php if(!$this->key):?>
<div style="padding-bottom:5px;"><?php echo $this->translator('search_not_key');?></div>
<?php else:?>
<div style="padding-bottom:15px;"><label style='color:#FF9900; font-weight:bold;'><?php echo $this->numEnterprise;?></label> <?php echo $this->translator('search_guide');?> "<label style='color:#FF9900; font-weight:bold;'><?php echo $this->exp['keyword'];?></label>"</div>
<?php
    $skin_url = $this->APP_STATIC_SERVER . '/skins/'. $this->APP_TEMPLATE . '/'. $this->APP_SKIN;
?>
<?php foreach ($this->enterprises as $enterprise):?>
<?php
    /**
    * Check image exist directory
    **/
    $file_noimage = $this->APP_STATIC_SERVER."/images/logos/no-logo.jpg";
    $file = $this->APP_STATIC_SERVER."/images/logos/".$enterprise->id.'.jpg';
    $path = str_replace($this->APP_STATIC_SERVER,getcwd(),$file);
    $urlImage = is_file($path)?$file:$file_noimage;

    /**
    * Param url detail
    **/
    $arrRouteDetail = array(
        'enterprise_id' => $enterprise->id,
        'enterprise_name' => Tomato_Utility_String::removeSign($enterprise->company_name_en, '-', true),
    );

    $enterprise_name = $enterprise->company_name_vn;

    /**
    * About us
    **/
    $info = $this->arrInfos[$enterprise->id];
?>
<div class="subrow clearfix">
    <div class="subcolumns_oldgecko" style="padding-bottom:5px;">
        <div style="float:left; width:17%">
            <a href="<?php echo $this->url($arrRouteDetail,'bizprofile_enterprise_index');?>"><img class="item_img" width="95" src="<?php echo $urlImage;?>" /></a>
        </div>
        <div style="float:left; width:83%" class="subcolumns">
            <div style="float:left; width:35%">
                <a href="<?php echo $this->url($arrRouteDetail,'bizprofile_enterprise_index');?>"><span class="title"><?php echo $enterprise_name;?></span></a>
                <br/><span style="text-transform:uppercase;"><?php echo $enterprise->company_name_en;?></span>
                <p style="padding-top:5px;"><?php echo $enterprise->contact_address;?></p>
            </div>
            <div style="float:right; width:63%">
                <div style="text-align:justify">
                    <?php echo isset($info->info_string)?Tomato_Helper_Helper::substring($info->info_string, 400):null;?>
                </div>
            </div>
        </div>
    </div>
</div>
<?php endforeach;?>

<?php if($this->numEnterprise > 0 ):?>
<div class="basic_paginator"><?php echo $this->paginator()->slide($this->paginator, $this->paginatorOptions);?></div>
<?php endif;?>
<script type="text/javascript">
$(document).ready(function() {
    $('.basic_paginator span a').click(function(evt){
        evt.preventDefault();
        href = $(this).attr('href');
        me = $(this);
        basicLoad1(me, href);
    });
});

function basicLoad1(me, url){
    var keyword = '<?php echo isset($this->exp['keyword'])?$this->exp['keyword']:null;?>';
    var city = '<?php echo isset($this->exp['city'])?$this->exp['city']:'all';?>';
    var professions = '<?php echo isset($this->exp['professions'])?$this->exp['professions']:'all';?>';
    var address = '<?php echo isset($this->exp['address'])?$this->exp['address']:null;?>';
    var type = '<?php echo isset($this->exp['type'])?$this->exp['type']:'basic';?>';

    http = 'http://'+'<?php echo $_SERVER['HTTP_HOST'];?>';
    route = http+url;
    $(me).html('').addClass('t_a_ui_helper_loading');
    jQuery.ajaxq('basic', {
        type: 'POST',
        url: route,
        data: { keyword:keyword , city:city , professions:professions , address:address , type:type },
        success: function(html) {
            $(me).html('').addClass('t_a_ui_helper_loading');
            $('#basicOutput').html(html);
        }
    });
}
</script>
<?php endif;?>